package com.tbit.uqbike.object.pojo.vo;

import com.tbit.uqbike.object.pojo.ParamDate;
import com.tbit.uqbike.webmanager.util.csv.annotations.Csv;
import com.tbit.uqbike.webmanager.util.csv.annotations.Sum;

import java.math.BigDecimal;

/**
 * 其他收支
 *
 * @Author:yanlun
 * @DATE: 2022/11/18
 */
public class AccountDayStatOtherDetailVO extends ParamDate {

    private Integer accountId;
    /**
     * 区域
     */
    @Csv(name = "区域")
    private String accountName;
    /**
     * 日期
     */
    @Csv(name = "日期")
    private String date;
    /**
     * 期初收支金额
     */
    @Csv(name = "期初收支金额")
    private BigDecimal termStart;
    /**
     * 本期其他收入
     */
    @Sum
    @Csv(name = "本期其他收入")
    private BigDecimal income;
    /**
     * 本期其他收入笔数
     */
    @Sum
    @Csv(name = "本期其他收入笔数")
    private Long incomeCount;
    /**
     * 本期其他支出
     */
    @Sum
    @Csv(name = "本期其他支出")
    private BigDecimal expend;
    /**
     * 本期其他支出笔数
     */
    @Sum
    @Csv(name = "本期其他支出笔数")
    private Long expendCount;
    /**
     * 期末收支金额
     */
    @Csv(name = "期末收支金额")
    private BigDecimal termEnd;

    public AccountDayStatOtherDetailVO() {
        fillData();
    }

    public Integer getAccountId() {
        return accountId;
    }

    public void setAccountId(Integer accountId) {
        this.accountId = accountId;
    }

    public String getAccountName() {
        return accountName;
    }

    public void setAccountName(String accountName) {
        this.accountName = accountName;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public BigDecimal getTermStart() {
        return termStart == null ? null : termStart.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setTermStart(BigDecimal termStart) {
        this.termStart = termStart;
    }

    public BigDecimal getIncome() {
        return income == null ? null : income.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setIncome(BigDecimal income) {
        this.income = income;
    }

    public Long getIncomeCount() {
        return incomeCount;
    }

    public void setIncomeCount(Long incomeCount) {
        this.incomeCount = incomeCount;
    }

    public BigDecimal getExpend() {
        return expend == null ? null : expend.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setExpend(BigDecimal expend) {
        this.expend = expend;
    }

    public Long getExpendCount() {
        return expendCount;
    }

    public void setExpendCount(Long expendCount) {
        this.expendCount = expendCount;
    }

    public BigDecimal getTermEnd() {
        return termEnd == null ? null : termEnd.setScale(2, BigDecimal.ROUND_HALF_UP);
    }

    public void setTermEnd(BigDecimal termEnd) {
        this.termEnd = termEnd;
    }

    public void fillData() {
        BigDecimal bigDecimal = new BigDecimal(0);
        this.termStart = this.termStart == null ? bigDecimal : this.termStart;
        this.income = this.income == null ? bigDecimal : this.income;
        this.incomeCount = this.incomeCount == null ? 0L : this.incomeCount;
        this.expend = this.expend == null ? bigDecimal : this.expend;
        this.expendCount = this.expendCount == null ? 0L : this.expendCount;
        this.termEnd = this.termEnd == null ? bigDecimal : this.termEnd;
    }
}
